package com.wanghua.mall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author wanghua
 * @create 2021-09-05 16:52
 * 用户普通注册提交的数据
 */
@Data
public class RegisterVo {

    @Length(min = 2, max = 20, message = "用户名长度必须在2-20之间")
    @NotEmpty(message = "用户名必须提交")
    private String username;

    @Length(min = 6, max = 20, message = "密码长度必须在6-20之间")
    @NotEmpty(message = "密码必须提交")
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "手机号格式不正确")
    private String phone;

    @NotEmpty(message = "验证码必须填写")
    private String code;
}
